qui(
    function (require, exports, module) {
        VODNew.Plugin = $.extend(true, {}, EpgWeb.Plugin, {
            tips: (function () {
                var str = '<div class="alert alert-dismissible" role="alert1" style="display: inline;text-align: center;width: 420px">'
                    + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
                    + '<span id="tips">{{cnt}}</span><strong style="margin-right:30px;">【3秒后自动关闭】</strong>'
                    + '</div>';
                var _timeId = null;

                return function (func, content) {
                    //移除旧对象
                    $("div[role=alert1]").remove();
                    if (_timeId) {
                        clearTimeout(_timeId);
                    }
                    var html = str;
                    html = html.replace(/{{cnt}}/g, content);
                    $(html).appendTo($(document.body));
                    //重新获取
                    var targetElement = $("div[role=alert1]");
                    targetElement.css("left", $(document.body).width() / 2 - $("div[role=alert1]").width() / 2);

                    if (func !== undefined) {
                        if (func == "success") {
                            targetElement.removeClass("alert-danger");
                            targetElement.addClass("alert-success");
                        }
                        else if (func == "error") {
                            targetElement.removeClass("alert-success");
                            targetElement.addClass("alert-danger");
                        }

                        _timeId = setTimeout(function(){
                            $('div[role=alert1]').find("button").trigger("click");
                        }, 3000);
                    }
                    else {
                        console.log("func is not exists!");
                    }
                };
            })()

        })
        VODNew.Plugin.Validate.bindDefaultHandler( function(msg){
            VODNew.Plugin.tips("error", msg);
        } );
    }
);